package master;

/**
 * Excel列表名称
 *
 * @author chenyw
 * @date 2022/7/31 9:58
 */
public class M168convertToTitle {
    public String convertToTitle(int columnNumber) {
        StringBuffer sb = new StringBuffer();
        while (columnNumber > 0) {
            columnNumber--;
            int tmp = columnNumber % 26;
            sb.append((char) (tmp + 'A'));
            columnNumber /= 26;
        }
        return sb.reverse().toString();
    }
}
